function convertArrayOfObjects(data) {
    let arr = JSON.parse(data)
    return arr.map(item => {
        const result = {};

        for (const key in item) {
            if (item.hasOwnProperty(key)) {
                result[key] = item[key].includes(',') ? item[key].split(',').map(Number) : item[key];
            }
        }

        return JSON.stringify(result);
    });
}

const originalData = [
    { name: "hmx", count: "1,2,3,4", attr: "1,2,3,4" },
    { name: "hmx", count: "1,2,3,4", attr: "1,2,3,4" },
    { name: "hmx", count: "1,2,3,4", attr: "1,2,3,4" }
];

const convertedData = convertArrayOfObjects(JSON.stringify(originalData));
console.log(convertedData);
